<?php echo $this->load->view('meta'); ?>
<!--[if IE]><script type="text/javascript" src="jquery.bgiframe.js"></script><![endif]-->
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?=$this->load->view('googlemapsapi');?>" type="text/javascript"></script>
<style type="text/css">
label {display:inline;}
</style>
<script type="text/javascript">
// select all desired input fields and attach tooltips to them 
// execute your scripts when the DOM is ready. this is a good habit
$(function() {
	$("#event :input.tooltip").tooltip({ 
 
    // place tooltip on the right edge 
    position: ['center', 'right'], 
 
    // a little tweaking of the position 
    offset: [-2, 10], 
 
    // use a simple show/hide effect 
    effect: 'toggle', 
     
    // custom opacity setting 
    opacity: 0.7 
	});
});
</script>
<?	for($i=1;$i<=12;$i++){
					$hour[$i] = $i;
				}
				for($i=0;$i<=59;$i++){
					$mins[sprintf("%02d",$i)] = sprintf("%02d",$i);
				}
				$half = array('am'=>'am','pm'=>'pm');
				$homepage = array('0'=>'no','1'=>'yes');
				$repeating = array('no'=>'no','weekly'=>'weekly');
				$repeats = array('0'=>'Does not repeat','1'=>'Daily','2'=>'Every weekday (Mon-Fri)','3'=>'Every Mon., Wed., and Fri.',
							'4'=>'Every Tues. and Thur.','5'=>'Weekly','6'=>'Monthly','7'=>'Yearly');
				$repeat_js = 'onChange="repeat_main(this.form)"';
?>
<title>xa-ncsu | calendar</title>
<?php echo $this->load->view('header'); ?>
<div id="content">
<?=$this->validation->error_string;?>
<? $hour['all'] = 'all'; $mins['all'] = 'all'?>
<?	for($i=1;$i<=12;$i++){
					$hour[$i] = $i;
				}
				for($i=0;$i<=59;$i++){
					$mins[sprintf("%02d",$i)] = sprintf("%02d",$i);
				}
				$half = array('am'=>'am','pm'=>'pm');
				$homepage = array('0'=>'no','1'=>'yes');
				$repeating = array('no'=>'no','weekly'=>'weekly');
				$repeats = array('0'=>'Does not repeat','1'=>'Daily','2'=>'Every weekday (Mon-Fri)','3'=>'Every Mon., Wed., and Fri.',
							'4'=>'Every Tues. and Thur.','5'=>'Weekly','6'=>'Monthly','7'=>'Yearly');
				$repeat_js = 'onChange="repeat_main()"; style="margin:5px;"';
				$homepage_js = 'style="width:10px;"';
			?>
<form id="event" name="event" method="post" action="<?=site_url('calendar/create')?>" style="width:700px;">
<fieldset>
	<legend><span>create a calendar entry</span></legend>
	<ol>
		<li><label for="name">what</label>
			<input type="text" name="name" value="<?=$this->validation->name;?>" class="calendarform tooltip"/><div class="tooltip">Should be a short one line event title.</div></li>
		<li><label for="when">when
			<input type="text" id="startDay" name="startDay" value="<?=$this->validation->startDay;?>" autocomplete="off" class="date-pick" style="width:80px;margin: 5px 0px 5px 115px;" maxlength="10" onChange="dateChanged(this.form)"/>
			<span id="stime"><input type="text" name="startTime" id="startTime" class="startTime" value="<?=$this->validation->startTime;?>" autocomplete="off"
			 style="width:86px;margin: 5px 0px 5px 5px;" maxlength="10"/></span>
			<input type="text" name="endDay" value="<?=$this->validation->endDay;?>" autocomplete="off" class="date-pick" style="width:86px;margin: 5px 0px 5px 5px;" maxlength="10"/>
			<span id="etime"><input type="text" name="endTime" id="endTime" autocomplete="off" class="startTime" value="<?=$this->validation->endTime;?>" style="width:100px;margin: 5px 0px 5px 5px;" maxlength="10"/></span>
			<input value="all_day" onclick="allDay(this.form)" id="aday" name="aday" type="checkbox" style="width:5px;">&nbsp;All day
			</label></li>
		<li><label for="repeats" style="margin: 0 0 0 20px;">repeats:</label>
			<?=form_dropdown('repeat_when',$repeats,$this->validation->repeat_when,$repeat_js)?>
			<?if($this->validation->repeat_when!=0):?>
				<div id="repeat_here" style="display:block; margin:5px;">
				<script type="text/javascript">
					var repeat_end = "<?=$this->validation->repeat_when;?>";
					repeat_main();
				</script>
			</div>
			<?endif;?>
			<span id="repeat_here" style="display:block; margin:5px;"></span></li>
		<li><label for="building">building</label>
			<input type="text" name="building" id="building" value="<?=$this->validation->building;?>" class="calendarform tooltip"/><div class="tooltip">Where is this event located.<br/>i.e. XA House, Talley Student Center</div></li>	
		<li><label for="where">where</label>
			<input type="text" name="where" id="where" value="<?=$this->validation->where;?>" class="calendarform tooltip" onchange="geocode(this.form)"/><div class="tooltip">Event's address: ex. 17 enterprise street, raleigh, nc.</div></li>
			<input type="hidden" name="street" id="street" value="<?=$this->validation->street?>" />
			<input type="hidden" name="city" id="city" value="<?=$this->validation->city?>" />
			<input type="hidden" name="state" id="state" value="<?=$this->validation->state?>" />
			<li><label for="description">description</label>
				<textarea id="description" name="description" class="calendarform tooltip"/><?=$this->validation->description;?></textarea><div class="tooltip">Where is this event about.<br />i.e. XA House, Talley Student Center</div></li>
		
		<li style="position:relative;top:25px;"><label for="category">group</label>
			<?=form_dropdown('category', $category,$this->validation->category);?></li>
		<li style="position:relative;top:15px;"><label for="homepage">display on homepage</label>
			<?=form_dropdown('homepage', $homepage,$this->validation->homepage,'class="time" style="width:70px;"');?></li>
		<li><?=form_submit('','publish')?> <?=anchor('admin/events', 'Cancel');?></li>
			<input type="hidden" name="geocode_point" id="geocode_point" value="<?=$this->validation->geocode_point;?>" />
			<input type="hidden" name="status" id="status" value="<?=$this->validation->status?>" />
	</ol>
</fieldset>
<?=form_close()?>
</div>
<?php echo $this->load->view('footer');?>
